{extend name="public/base" /}
{block name="title"}新增用户{/block}
{block name="css"}
<link href="__PUBLIC__/static/inspinia/css/plugins/chosen/chosen.css" rel="stylesheet">
{/block}
{block name="main"}

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>新增用户</h5>
                <div class="ibox-tools">
                    <a class="collapse-link">
                        <i class="fa fa-chevron-up"></i>
                    </a>
                    <a class="close-link">
                        <i class="fa fa-times"></i>
                    </a>
                </div>
            </div>
            <div class="ibox-content">
                <form class="form-horizontal ajax-form" action="{:url('User/addUser')}" method="post">
                    <input type="password" style="display:none"><!-- for disable autocomplete on chrome -->
                    <div class="form-group">
                        <label class="col-lg-2 control-label">用户分组</label>
                        <div class="col-lg-10">
                            <select name="group_ids[]" tabindex="4" required="" data-placeholder="选择分组" class="form-control chosen-select form-control chosen-select-deselect chosen-select-no-single chosen-select-no-results chosen-select-search" multiple style="width:100%!important;">
                                {volist name="groups" id="vo"}
                                <option value="{$vo.id}">{$vo.title}</option>
                                {/volist}
                            </select>
                            <span class="help-block m-b-none">普通用户可以不选分组</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">昵称</label>
                        <div class="col-lg-10"><input type="text" name="nickname" placeholder="昵称" class="form-control" autocomplete="off"> <span class="help-block m-b-none"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">手机号</label>
                        <div class="col-lg-10"><input type="text" name="mobile" placeholder="11位手机号" class="form-control" autocomplete="off" maxlength="11"> <span class="help-block m-b-none"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">邮箱</label>
                        <div class="col-lg-10"><input type="email" name="email" placeholder="邮箱" class="form-control"> <span class="help-block m-b-none"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">登录密码</label>
                        <div class="col-lg-10"><input type="password" name="password" placeholder="登录密码" class="form-control" autocomplete="off"> <span class="help-block m-b-none"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-lg-2 control-label">确认密码</label>
                        <div class="col-lg-10">
                            <input type="password" name="repassword" placeholder="确认密码" class="form-control" autocomplete="off">
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-lg-offset-2 col-lg-10">
                            <input type="hidden" name="status" value="1">
                            <button class="btn btn-normal btn-primary" type="submit">提交</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{/block}


{block name="js"}
<!-- Chosen -->
<script src="__PUBLIC__/static/inspinia/js/plugins/chosen/chosen.jquery.js"></script>

<script>
    var config = {
        '.chosen-select': {},
        '.chosen-select-deselect': {allow_single_deselect: true},
        '.chosen-select-search': {search_contains: true},
        '.chosen-select-no-single': {disable_search_threshold: 10},
        '.chosen-select-no-results': {no_results_text: '没有匹配的选项'},
        '.chosen-select-width': {width: "100%!important"}
    }
    for (var selector in config) {
        $(selector).chosen(config[selector]);
    }
</script>
{/block}
